﻿namespace EyeOpen.Cart.Web.Service
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using EyeOpen.Cart.Service;
    using EyeOpen.Cart.Web.ArticleLineServiceReference;

    public class ArticleLineClient
    {
        public ArticleLineDto[] GetAll()
        {
            ArticleLineDto[] data;

            using (ArticleLineServiceClient articleLineServiceClient = new ArticleLineServiceClient())
            {
                data = articleLineServiceClient
                        .GetAll();
            }

            return data;
        }

        public float CalculateArticleLineTotal(ArticleLineDto articleLineDto)
        {
            float result;

            using (ArticleLineServiceClient articleLineServiceClient = new ArticleLineServiceClient())
            {
                result = articleLineServiceClient.CalculateArticleLineTotal(articleLineDto);    
            }

            return result;
        }

        public float CalculateArticlesTotal(ArticleLineDto[] collection)
        {
            float result;

            using (ArticleLineServiceClient articleLineServiceClient = new ArticleLineServiceClient())
            {
                result = articleLineServiceClient.CalculateArticlesTotal(collection);
            }

            return result;
        }
    }
}
